import { ref } from "vue";

export interface VariableItem {
  id: string;
  name: string;
  value: string;
  display?: string; // 展示用占位符（如 ${节点名称,出参key}）
}

// 全局可复用的三类变量（按需初始化一些预置项）
const processVariables = ref<VariableItem[]>([
  { id: "1", name: "项目名称", value: "${running,项目}" },
  { id: "2", name: "客户名称", value: "${running,客户}" },
  { id: "3", name: "项目经理", value: "${running,项目经理}" },
]);

const outputVariables = ref<VariableItem[]>([]);

const systemVariables = ref<VariableItem[]>([
  { id: "sys1", name: "当前时间", value: "${system,当前时间}" },
  { id: "sys2", name: "用户ID", value: "${system,用户ID}" },
]);

export function useWorkflowVariables() {
  return {
    processVariables,
    outputVariables,
    systemVariables,
  };
}
